
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>The TeX input processor &mdash; MathJax v2.0 documentation</title>
    <link rel="stylesheet" href="../_static/mj.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <!--<script type="text/javascript" src="../../../MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>-->
    <link rel="top" title="MathJax v2.0 documentation" href="../index.html" />
    <link rel="up" title="Configuration Objects" href="index.html" />
    <link rel="next" title="The MathML input processor" href="MathML.html" />
    <link rel="prev" title="The jsMath2jax Preprocessor" href="jsMath2jax.html" /> 
  </head>
  <body>
    
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="MathML.html" title="The MathML input processor"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="jsMath2jax.html" title="The jsMath2jax Preprocessor"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">MathJax v2.0 documentation</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">Configuration Objects</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="the-tex-input-processor">
<span id="configure-tex"></span><h1>The TeX input processor<a class="headerlink" href="#the-tex-input-processor" title="Permalink to this headline">¶</a></h1>
<p>The options below control the operation of the TeX input processor
that is run when you include <tt class="docutils literal"><span class="pre">&quot;input/TeX&quot;</span></tt> in the <cite>jax</cite> array of
your configuration or load a combined configuration file that includes
the TeX input jax.  They are listed with their default values.  To
set any of these options, include a <tt class="docutils literal"><span class="pre">TeX</span></tt> section in your
<tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Hub.Config()</span></tt> call.  For example</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">MathJax</span><span class="p">.</span><span class="nx">Hub</span><span class="p">.</span><span class="nx">Config</span><span class="p">({</span>
  <span class="nx">TeX</span><span class="o">:</span> <span class="p">{</span>
    <span class="nx">Macros</span><span class="o">:</span> <span class="p">{</span>
      <span class="nx">RR</span><span class="o">:</span> <span class="s1">&#39;{\\bf R}&#39;</span><span class="p">,</span>
      <span class="nx">bold</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;{\\bf #1}&#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">]</span>
    <span class="p">}</span>
  <span class="p">}</span>
<span class="p">});</span>
</pre></div>
</div>
<p>would set the <tt class="docutils literal"><span class="pre">Macros</span></tt> configuration option to cause two new macros
to be defined within the TeX input processor.</p>
<dl class="describe">
<dt>
<tt class="descname">TagSide: &quot;right&quot;</tt></dt>
<dd><p>This specifies the side on which <tt class="docutils literal"><span class="pre">\tag{}</span></tt> macros will place the
tags.  Set it to <tt class="docutils literal"><span class="pre">&quot;left&quot;</span></tt> to place the tags on the left-hand side.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">TagIndent: &quot;.8em&quot;</tt></dt>
<dd><p>This is the amount of indentation (from the right or left) for the
tags produced by the <tt class="docutils literal"><span class="pre">\tag{}</span></tt> macro.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">MultLineWidth: &quot;85%&quot;</tt></dt>
<dd><p>The width to use for the <cite>multline</cite> environment that is part of
the <tt class="docutils literal"><span class="pre">AMSmath</span></tt> extension.  This width gives room for tags at
either side of the equation, but if you are displaying mathematics
in a small area or a thin column of text, you might need to change
the value to leave sufficient margin for tags.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">equationNumbers: {}</tt></dt>
<dd><p>This object controls the automatic equation numbering and the
equation referencing.  It contains the following values:</p>
<dl class="describe">
<dt>
<tt class="descname">autoNumber: &quot;none&quot;</tt></dt>
<dd><p>This controls whether equations are numbered and how.  By
default it is set to <tt class="docutils literal"><span class="pre">&quot;none&quot;</span></tt> to be compatible with earlier
versions of MathJax where auto-numbering was not performed (so
pages will not change their appearance).  You can change
this to <tt class="docutils literal"><span class="pre">&quot;AMS&quot;</span></tt> for equations numbered as the <cite>AMSmath</cite>
package would do, or <tt class="docutils literal"><span class="pre">&quot;all&quot;</span></tt> to get an equation number for
every displayed equation.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">formatNumber: function (n) {return n}</tt></dt>
<dd><p>A function that tells MathJax what tag to use for equation
number <tt class="docutils literal"><span class="pre">n</span></tt>.  This could be used to have the equations labeled
by a sequence of symbols rather than numbers, or to use section
and subsection numbers instead.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">formatTag: function (n) {return '('+n+')'}</tt></dt>
<dd><p>A function that tells MathJax how to format an equation number
for displaying as a tag for an equation.  This is what appears
in the margin of a tagged or numbered equation.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">formatID: function {return 'mjx-eqn-'+String(n).replace(/[:'&quot;&lt;&gt;&amp;]/g,&quot;&quot;)}</tt></dt>
<dd><p>A function that rells MathJax what ID to use as an anchor for
the equation (so that it can be used in URL references).</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">formatURL: function (id) {return '#'+escape(id)}</tt></dt>
<dd><p>A function that takes an equation ID and returns the URL to
link to it.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">useLabelIds: true</tt></dt>
<dd><p>This controls whether element ID&#8217;s use the <tt class="docutils literal"><span class="pre">\label</span></tt> name or
the equation number.  When <tt class="docutils literal"><span class="pre">true</span></tt>, use the label, when
<tt class="docutils literal"><span class="pre">false</span></tt>, use the equation number.</p>
</dd></dl>

<p>See the <a class="reference external" href="http://cdn.mathjax.org/mathjax/latest/test/examples.html">MathJax examples page</a> for
some examples of equation numbering.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">Macros: {}</tt></dt>
<dd><p>This lists macros to define before the TeX input processor begins.
These are <cite>name:value</cite> pairs where the <cite>name</cite> gives the name of
the TeX macro to be defined, and <cite>value</cite> gives the replacement
text for the macro.  The <cite>value</cite> can be an array of the form
<cite>[value,n]</cite>, where <cite>value</cite> is the replacement text and <cite>n</cite> is the
number of parameters for the macro.  Note that since the <cite>value</cite>
is a javascript string, backslashes in the replacement text must
be doubled to prevent them from acting as javascript escape
characters.</p>
<p>For example,</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">Macros</span><span class="o">:</span> <span class="p">{</span>
  <span class="nx">RR</span><span class="o">:</span> <span class="s1">&#39;{\\bf R}&#39;</span><span class="p">,</span>
  <span class="nx">bold</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;{\\bf #1}&#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<p>would ask the TeX processor to define two new macros:  <tt class="docutils literal"><span class="pre">\RR</span></tt>,
which produces a bold-face &#8220;R&#8221;, and <tt class="docutils literal"><span class="pre">\bold{...}</span></tt>, which takes one
parameter and sets it in the bold-face font.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">MAXMACROS: 10000</tt></dt>
<dd><p>Because a definition of the form <tt class="docutils literal"><span class="pre">\def\x{\x}</span> <span class="pre">\x</span></tt> would cause MathJax
to loop infinitely, the <cite>MAXMACROS</cite> constant will limit the number of
macro substitutions allowed in any expression processed by MathJax.</p>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">MAXBUFFER: 5*1024</tt></dt>
<dd><p>Because a definition of the form <tt class="docutils literal"><span class="pre">\def\x{\x</span> <span class="pre">aaa}</span> <span class="pre">\x</span></tt> would loop
infinitely, and at the same time stack up lots of a&#8217;s in MathJax&#8217;s
equation buffer, the <cite>MAXBUFFER</cite> constant is used to limit the size of
the string being processed by MathJax.  It is set to 5KB, which should
be sufficient for any reasonable equation.</p>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="jsMath2jax.html"
                        title="previous chapter">The jsMath2jax Preprocessor</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="MathML.html"
                        title="next chapter">The MathML input processor</a></p>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="MathML.html" title="The MathML input processor"
             >next</a> |</li>
        <li class="right" >
          <a href="jsMath2jax.html" title="The jsMath2jax Preprocessor"
             >previous</a> |</li>
        <li><a href="../index.html">MathJax v2.0 documentation</a> &raquo;</li>
          <li><a href="index.html" >Configuration Objects</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012 Design Science.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
    
  </body>
</html>